﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using OfficeOpenXml;
using OfficeOpenXml.Style;

namespace ServisniList.Rukovatelji
{
    class ExcelExportHelpers
    {
        public static void postaviHeaderCeliju(ExcelRange celija, string vrijednost)
        {
            celija.Value = vrijednost;
            var fill = celija.Style.Fill;
            fill.PatternType = ExcelFillStyle.Solid;
            fill.BackgroundColor.SetColor(Color.LightGreen);
            var border = celija.Style.Border;
            border.Bottom.Style = border.Top.Style = border.Left.Style = border.Right.Style = ExcelBorderStyle.Thin;
            celija.AutoFitColumns(25);
        }

        public static void postavipodatakCeliju(ExcelRange celija, string vrijednost)
        {
            celija.Value = vrijednost;
            var fill = celija.Style.Fill;
            fill.PatternType = ExcelFillStyle.Solid;
            fill.BackgroundColor.SetColor(Color.LightGray);
            var border = celija.Style.Border;
            border.Bottom.Style = border.Top.Style = border.Left.Style = border.Right.Style = ExcelBorderStyle.Thin;
            celija.AutoFitColumns(50);
        }
    }
}
